package router

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
	"tuowei.com/app/admin/apis"
	"tuowei.com/common/actions"
	"tuowei.com/common/middleware"
)

func init() {
	routerCheckRole = append(routerCheckRole, sysStudentRouter)
}

// 需认证的路由代码
func sysStudentRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := apis.SysStudent{}
	r := v1.Group("/sys-student").
		Use(authMiddleware.MiddlewareFunc()).
		Use(middleware.AuthCheckRole()).Use(actions.PermissionAction())
	{
		r.GET("", api.GetPage)
		//r.GET("/userList", api.GetUserList)
		r.GET("/:id", api.Get)
		r.GET("/change/status/:id", api.ChangeStatus)
		r.POST("", api.Insert)
		r.PUT("", api.Update)
		// 批量更新学员购买状态
		r.PUT("/updateBuyStatus", api.UpdateBuyStatus)
		// 导出excel
		r.GET("excel", api.Excel)
		// 获取某个班级的学生
		r.GET("getListByClassId", api.GetListByClassId)
		// 获取没有班级的学生
		r.GET("getNoClassStudents", api.GetNoClassStudents)
		//r.DELETE("", api.Delete)
	}

}
